/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package server;
import java.util.Scanner;
import stringhelper.*;
/**
 *
 * @author Welcome
 */
public class ServerHandler {
    
    public static void main(String[] args)throws Exception
    {
        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap chuoi");
        String statement="";
        statement = scan.nextLine();
        StatementHandler statementHandler = new StatementHandler(statement);
        
        statementHandler.Cutter();
        
        KindOfStatement kindOfStatement = statementHandler.getSqlStatement().getKindOfStatement();
        switch (kindOfStatement)
        {
            case SELECT:
                XulySelect(statementHandler.getSqlStatement());
                break;
        }
        
        System.out.println(statementHandler.getSqlStatement().getKindOfStatement());
        
        DatabaseHandler databaseHandler = new DatabaseHandler();
        databaseHandler.getDataFromFile();
        //System.out.println(databaseHandler.getDatabaseNames().length);
        
    }

    

    private static void XulySelect(SQLStatement sqlStatement)throws Exception {
        //throw new UnsupportedOperationException("Not yet implemented");
        String[] Fields = sqlStatement.getTempField();
        String[] Tables = sqlStatement.getTempTable();
        
    }
}
